<%@ page language="java" %>
<%@ page import="com.scalar.chiptrack.users.User,
				 java.util.ArrayList,
                 com.scalar.chiptrack.users.UserGroup,
                 com.scalar.chiptrack.commons.SessionKeys,
                 com.scalar.chiptrack.utils.ConfigManager,
				 com.scalar.chiptrack.users.Functionality,
				 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.operations.process.VendorLocation,
				 com.scalar.chiptrack.operations.vendor.dao.VendorDAO" %>

<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<chiptrack:checkLogon sourcePage="/adapterSetup.do"/>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML><HEAD>
    <script language="javascript">

      function returnLocations(checks,locations){

        var selectedLocations=new Array();
        var count = 0
        var remove = eval(checks+'.value');
        if (remove =="-1"){
            selectedLocations ='';
            return selectedLocations;
        }
        var test =eval(checks+'.length');
       if (test ==null){
            if(eval(checks+'.checked') == true){
                value = eval(locations+'.value');
                selectedLocations[count]=value;
            }
            else{
                selectdedLocations=null;
           }
            return selectedLocations;
        }else{
            var selectedLocations=new Array();
            var count = 0
            for (var j =0;j<test;j++){
                if(eval(checks+'[j].checked') == true){
                    value = eval(locations+'[j].value')
                    selectedLocations[count]=value;
                    count++;
                }
            }
            return selectedLocations;
	    }
    }

    function submitSetup(){
        document.adapterSetupForm.selectedFabLocations.value=returnLocations("document.adapterSetupForm.fabLoc","document.adapterSetupForm.findSelectedFabLocations");
        document.adapterSetupForm.selectedWaferStoreLocations.value=returnLocations("document.adapterSetupForm.waferStoreLoc","document.adapterSetupForm.findSelectedWaferStoreLocations");
       	document.adapterSetupForm.selectedSortLocations.value=returnLocations("document.adapterSetupForm.sortLoc","document.adapterSetupForm.findSelectedSortLocations");
       	document.adapterSetupForm.selectedDieBankLocations.value=returnLocations("document.adapterSetupForm.dieBankLoc","document.adapterSetupForm.findSelectedDieBankLocations");
        document.adapterSetupForm.selectedAssemblyLocations.value=returnLocations("document.adapterSetupForm.assemblyLoc","document.adapterSetupForm.findSelectedAssemblyLocations");
       	document.adapterSetupForm.selectedClassStoreLocations.value=returnLocations("document.adapterSetupForm.classStoreLoc","document.adapterSetupForm.findSelectedClassStoreLocations");
	    document.adapterSetupForm.selectedTestLocations.value=returnLocations("document.adapterSetupForm.testLoc","document.adapterSetupForm.findSelectedTestLocations");
	    document.adapterSetupForm.selectedMarkAndPackLocations.value=returnLocations("document.adapterSetupForm.markAndPackLoc","document.adapterSetupForm.findSelectedMarkAndPackLocations");
    	document.adapterSetupForm.selectedFinishedGoodsLocations.value=returnLocations("document.adapterSetupForm.finishedGoodsLoc","document.adapterSetupForm.findSelectedFinishedGoodsLocations");
    	document.adapterSetupForm.action="<%=chipTracContext%>/adapterSetup.do?action=save";
	    document.adapterSetupForm.submit();
     }

  </script>

  <TITLE>Scalarsoft - ChipTrac</TITLE>
  <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  <meta http-equiv="Expires" content="text/html; charset=windows-1252">
  <LINK href='<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css' type='text/css' rel='stylesheet'>
</HEAD>
  <BODY bgColor='#ffffff' leftMargin='0' topMargin='0' marginheight='0' marginwidth='0'>
        <!-- Top Header Start-->
        <%@include file="/jsp/includes/header.jsp"  %>
        <!-- Top Header End-->
  
        <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
	        <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
            <!-- Side Navigation start -->
            <%@ include file="/jsp/admin/admin_menu.jsp" %>
            <!-- end of the side navigations -->
    	    </td>

            <TD bgcolor="#ffffff"><IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
            <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
            <TD valign="top" width="100%"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
            <BR>

            <!-- from here your body starts -->
            <html:form name="adapterSetupForm" method="post" action="/adapterSetup.do"
                        type="com.scalar.chiptrack.users.forms.AdapterSetupForm">
            <!-- Hidden variables were declared for the locations selected that had to be passed on to the action-->
            <input type = "hidden" name ="selectedFabLocations" value = "">
            <input type = "hidden" name ="selectedWaferStoreLocations" value = "">
            <input type = "hidden" name ="selectedSortLocations" value = "">
            <input type = "hidden" name ="selectedDieBankLocations" value = "">
            <input type = "hidden" name ="selectedAssemblyLocations" value = "">
            <input type = "hidden" name ="selectedClassStoreLocations" value = "">
            <input type = "hidden" name ="selectedTestLocations" value = "">
            <input type = "hidden" name ="selectedMarkAndPackLocations" value = "">
            <input type = "hidden" name ="selectedFinishedGoodsLocations" value = "">
            <input type = "hidden" name = "remove" value = "">

            <center><span class="NArialW">Select Vendors to setup Adaptor Setting </span></center>
            <img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

        <%
          ArrayList checked = (ArrayList)request.getAttribute("allCheckedLocations");
          boolean flag = false;
          boolean noLocations = true; %>

         <table align = center width = "80%">

	     <tr><td colspan = 5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
	     <% if ( !user.isActionAllowed ( Functionality.ADAPTER_SETUP, User.USER_ACTION_MODIFY  )  ) { %>
	        <tr><td colspan='5'><font class='NArialS'><font color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></td></tr>
	     <% } %>
         <tr><td colspan = 5><chiptrack:info styleClass='NArialL'/></td></tr>
         <tr><td colspan = 5><chiptrack:errors styleClass='NArialL'/></td></tr>
  	    <tr>
		    <td bgcolor="#993333" width="25%" class='NArialL' height = 30 align = center><font color="#FFFFFF" >STAGE</font></td>
		    <td colspan = 7 bgcolor="#993333" width="75%" class='NArialL' align = center><font color="#FFFFFF" >LOCATIONS</font></td>
	    </tr>
	    <tr><td colspan = 5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
	    <%
            ArrayList fabLocationArrayList  = (ArrayList)request.getAttribute("fabLocations");
            VendorLocation ifFabPresent = new VendorLocation();
	        ifFabPresent = (VendorLocation)fabLocationArrayList.get(0);
	        if (ifFabPresent.getLocationID() !=null){
                //if( !noLocations )
                noLocations = false;
            %>
			    <tr >
				<td width="25%" class='NArialL' ><font align="center">FAB</font></td>
				<%
					VendorLocation fabLocation = new VendorLocation();
					for (int i =0;i<fabLocationArrayList.size();i++ )
                    {
						fabLocation = (VendorLocation)fabLocationArrayList.get(i);
                 %>
						<td bgcolor="#993333" width="2%" align="center" >
						<!--Bhaskar code block 22 oct 2003-->
						<% int size = checked.size();
						  flag = false;
						  for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                          {
						    if ( ( (VendorLocation) checked.get( checkedLocations ) ).getLocationID().trim().equalsIgnoreCase(fabLocation.getLocationID().trim()))
                            {
						        flag = true;
                             }
                          }
                          %>
                          <input type="checkbox" name='fabLoc' class="txfield" <%= flag ? "checked":""%> >
                          <!--Bhaskar code block 22 oct 2003-->
                         <font class="NArialL"><input type="hidden" name='findSelectedFabLocations' value="<%=fabLocation.getLocationID()%>" class="txfield" ></font>
                         </td>
                         <td width='20%' class='NArialL' ><%=fabLocation.getLocationName()%></td>
			      <% } %>
		        </tr>
    	    <% } else {
                //if (ifFabPresent.getLocationID() ==null) noLocations = true; %>
		        <input type="hidden" name='fabLoc' class="txfield" value = "-1">
		    <% } %>
	
	       <%
            ArrayList waferStoreLocationArrayList  = (ArrayList)request.getAttribute("waferStoreLocations");
            VendorLocation ifWaferPresent = new VendorLocation();
	        ifWaferPresent = (VendorLocation)waferStoreLocationArrayList.get(0);
	        if (ifWaferPresent.getLocationID() !=null){
                 //if( !noLocations )
	             noLocations = false;
                 %>
                <tr >
			    	<td width="25%" class='NArialL' ><font align="center">WAFER STORE</font></td>
    				<%
	    				VendorLocation waferStoreLocation = new VendorLocation();
    					for (int i =0;i<waferStoreLocationArrayList.size();i++ )
                        {
			    			waferStoreLocation = (VendorLocation)waferStoreLocationArrayList.get(i);
                        %>
    						<td bgcolor="#993333" width="2%" align="center" >
							<!--Bhaskar code block 22 oct 2003-->
							<% int size = checked.size();
							  flag = false;
							  for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                              {
							    if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(waferStoreLocation.getLocationID().trim()))
                                {
							      flag = true;
							    }
                            }
                        %>
                        <input type="checkbox" name='waferStoreLoc' class="txfield" <%= flag ? "checked":""%> >
                        <!--Bhaskar code block 22 oct 2003-->
                        <!--input type="checkbox" name='waferStoreLoc' class="txfield" checked-->
                        <font class="NArialL"><input type="hidden" name='findSelectedWaferStoreLocations' value="<%=waferStoreLocation.getLocationID()%>" class="txfield" ></font>
                    </td>
					<td width='20%' class='NArialL' ><%=waferStoreLocation.getLocationName()%></td>
			        <% } %>
            	    </tr>
	            <% } else {
	                //if (ifWaferPresent.getLocationID() ==null) { noLocations = true; %>
		             <input type="hidden" name='waferStoreLoc' class="txfield" value = "-1">
		        <% } %>
	
	            <%
                    ArrayList sortLocationArrayList  = (ArrayList)request.getAttribute("sortLocations");
	                VendorLocation ifSortPresent = new VendorLocation();
	                ifSortPresent = (VendorLocation)sortLocationArrayList.get(0);
	                if (ifSortPresent.getLocationID() !=null)
                    {
                        //if( !noLocations )
		                noLocations = false;
                        %>
                        <tr >
				        <td width="25%" class='NArialL' ><font align="center">SORT</font></td>
				        <%
					    VendorLocation sortLocation = new VendorLocation();
					    for (int i =0;i<sortLocationArrayList.size();i++ ){
						    sortLocation = (VendorLocation)sortLocationArrayList.get(i);
                        %>
    					    <td bgcolor="#993333" width="2%" align="center" >
						    <!--Bhaskar code block 22 oct 2003-->
						    <% int size = checked.size();
						      flag = false;
						      for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                              {
	    					    if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(sortLocation.getLocationID().trim()))
                                {
		    				       flag = true;
   						        }
                              } %>
						    <input type="checkbox" name='sortLoc' class="txfield" <%= flag ? "checked":""%> >
						    <!--Bhaskar code block 22 oct 2003-->
						    <!--input type="checkbox" name='sortLoc' class="txfield" checked-->
						    <font class="NArialL"><input type="hidden" name='findSelectedSortLocations' value="<%=sortLocation.getLocationID()%>" class="txfield" ></font>
						    </td>
                            <td width='20%' class='NArialL' ><%=sortLocation.getLocationName()%></td>
    				    <% } %>
            	    </tr>
	            <% }  else {
	                //if (ifSortPresent.getLocationID() ==null) { noLocations = true; %>
		            <input type="hidden" name='sortLoc' class="txfield" value = "-1">
		        <% } %>

                <%
                  ArrayList dieBankLocationArrayList  = (ArrayList)request.getAttribute("dieBankLocations");
	              VendorLocation ifDiePresent = new VendorLocation();
	              ifDiePresent  = (VendorLocation)dieBankLocationArrayList.get(0);
	              if (ifDiePresent .getLocationID() !=null)
                  {
	                  //if( !noLocations )
                      noLocations = false;
                     %>
            	    <tr >
				    <td width="25%" class='NArialL' ><font align="center">DIE BANK</font></td>
                    <%
    				    VendorLocation dieBankLocation = new VendorLocation();
					    for (int i =0;i<dieBankLocationArrayList.size();i++ ){
						    dieBankLocation = (VendorLocation)dieBankLocationArrayList.get(i);
                        %>
    					    <td bgcolor="#993333" width="2%" align="center" >
						    <!--Bhaskar code block 22 oct 2003-->
						    <% int size = checked.size();
						        flag = false;
						        for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                                {
					    	      if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(dieBankLocation.getLocationID().trim()))
                                  {
						    	    flag = true;
							      }
                                }
                            %>
						    <input type="checkbox" name='dieBankLoc' class="txfield" <%= flag ? "checked":""%> >
						    <!--Bhaskar code block 22 oct 2003-->
						    <!--input type="checkbox" name='dieBankLoc' class="txfield" checked -->
						    <font class="NArialL"><input type="hidden" name='findSelectedDieBankLocations' value="<%=dieBankLocation.getLocationID()%>" class="txfield" ></font>
						    </td>
                            <td width='20%' class='NArialL' ><%=dieBankLocation.getLocationName()%></td>
				       <%  }  %>
            	       </tr>
	               <% } else {
	                //if (ifDiePresent .getLocationID() ==null) { noLocations = true; %>
		            <input type="hidden" name='dieBankLoc' class="txfield" value = "-1">
		           <%  }   %>

                 <%
                    ArrayList assemblyLocationArrayList  = (ArrayList)request.getAttribute("assemblyLocations");
	                VendorLocation ifAssemblyPresent = new VendorLocation();
	                ifAssemblyPresent = (VendorLocation)assemblyLocationArrayList.get(0);
	                if (ifAssemblyPresent.getLocationID() !=null){
                        //if( !noLocations )
	                     noLocations = false;
                        %>
                	    <tr>
    				    <td width="25%" class='NArialL' ><font align="center">ASSEMBLY</font></td>
    				    <%
    				    VendorLocation assemblyLocation = new VendorLocation();
					    for (int i =0;i<assemblyLocationArrayList.size();i++ ){
						    assemblyLocation = (VendorLocation)assemblyLocationArrayList.get(i);
                        %>
						    <td bgcolor="#993333" width="2%" align="center" >
					        <!--Bhaskar code block 22 oct 2003-->
					        <% int size = checked.size();
					            flag = false;
					            for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                                {
							      if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(assemblyLocation.getLocationID().trim()))
                                  {
					    		    flag = true;
							      }
                              } %>
                            <input type="checkbox" name='assemblyLoc' class="txfield" <%= flag ? "checked":""%> >
                            <!--Bhaskar code block 22 oct 2003-->
                            <!--input type="checkbox" name='assemblyLoc' class="txfield" checked -->
                            <font class="NArialL"><input type="hidden" name='findSelectedAssemblyLocations' value="<%=assemblyLocation.getLocationID()%>" class="txfield" ></font>
                            </td>
    						<td width='20%' class='NArialL' ><%=assemblyLocation.getLocationName()%></td>
        				<% } %>
                    	</tr>
	            <% } else {
                    //if (ifAssemblyPresent.getLocationID() ==null) { noLocations = true; %>
		            <input type="hidden" name='assemblyLoc' class="txfield" value = "-1">
		        <% } %>

            	<%
                    ArrayList testLocationArrayList  = (ArrayList)request.getAttribute("testLocations");
                    VendorLocation ifTestPresent = new VendorLocation();
	                ifTestPresent = (VendorLocation)testLocationArrayList.get(0);
	                if (ifTestPresent.getLocationID() !=null){
                        //if( !noLocations )
	                    noLocations = false; %>
	                    <tr>
    	    			<td width="25%" class='NArialL' ><font align="center">TEST</font></td>
		        		<%
				        	VendorLocation testLocation = new VendorLocation();

			            	for (int i =0;i<testLocationArrayList.size();i++ ) {
                                testLocation = (VendorLocation)testLocationArrayList.get(i);%>
        						<td bgcolor="#993333" width="2%" align="center" >
		    					<!--Bhaskar code block 22 oct 2003-->
						    	<% int size = checked.size();
							    flag = false;
							    for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                                {
							       if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(testLocation.getLocationID().trim()))
                                   {
							         flag = true;
							       }
                                }
                                %>
						    	<input type="checkbox" name='testLoc' class="txfield" <%= flag ? "checked":""%> >
							    <!--Bhaskar code block 22 oct 2003-->
							    <!--input type="checkbox" name='testLoc' class="txfield" checked-->
							    <font class="NArialL"><input type="hidden" name='findSelectedTestLocations' value="<%=testLocation.getLocationID()%>" class="txfield" ></font>
						        </td>
        						<td width='20%' class='NArialL' ><%=testLocation.getLocationName()%></td>
           				<% } %>
                	</tr>
	            <% } else {
	                // if (ifTestPresent.getLocationID() ==null) { noLocations = true; %>
		            <input type="hidden" name='testLoc' class="txfield" value = "-1">
		       <% } %>

             <%
                ArrayList classStoreLocationArrayList  = (ArrayList)request.getAttribute("classStoreLocations");
	            VendorLocation ifClassPresent = new VendorLocation();
	            ifClassPresent = (VendorLocation)classStoreLocationArrayList.get(0);
	            if (ifClassPresent.getLocationID() !=null) {
                        //if( !noLocations )
            	        noLocations = false; %>
        	            <tr>
		        		<td width="25%" class='NArialL' ><font align="center">CLASS STORE</font></td>
		        <%
					    VendorLocation classStoreLocation = new VendorLocation();
			    		for (int i =0;i<classStoreLocationArrayList.size();i++ ){
						classStoreLocation = (VendorLocation)classStoreLocationArrayList.get(i);%>

						<td bgcolor="#993333" width="2%" align="center" >
						<!--Bhaskar code block 22 oct 2003-->
						<% int size = checked.size();
						flag = false;
						for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                        {
						  if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(classStoreLocation.getLocationID().trim()))
                          {
							flag = true;
							}
                        }
                        %>
					    <input type="checkbox" name='classStoreLoc' class="txfield" <%= flag ? "checked":""%> >
						<!--Bhaskar code block 22 oct 2003-->
						<!--input type="checkbox" name='classStoreLoc' class="txfield" checked -->
						<font class="NArialL"><input type="hidden" name='findSelectedClassStoreLocations' value="<%=classStoreLocation.getLocationID()%>" class="txfield" ></font>
						</td>
						<td width='20%' class='NArialL' ><%=classStoreLocation.getLocationName()%></td>
    				<%  } %>
                	</tr>
	          <% } else  {
	            // if (ifClassPresent.getLocationID() ==null) { noLocations = true; %>
		        <input type="hidden" name='classStoreLoc' class="txfield" value = "-1">
		      <% } %>

	           <%
                  ArrayList markAndPackLocationArrayList  = (ArrayList)request.getAttribute("markAndPackLocations");
                  VendorLocation ifMarkPresent = new VendorLocation();
	              ifMarkPresent = (VendorLocation)markAndPackLocationArrayList.get(0);
	              if (ifMarkPresent.getLocationID() !=null) {
	                // if ( !noLocations )
                     noLocations = false; %>
	                 <tr>
    				<td width="25%" class='NArialL' ><font align="center">MARK & PACK</font></td>
    				<%
					VendorLocation markAndPackLocation = new VendorLocation();
					for (int i =0;i<markAndPackLocationArrayList.size();i++ ) {
						markAndPackLocation = (VendorLocation)markAndPackLocationArrayList.get(i);%>
						<td bgcolor="#993333" width="2%" align="center" >
						<!--Bhaskar code block 22 oct 2003-->
						<% int size = checked.size();
						  flag = false;
						  for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                          {
							if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(markAndPackLocation.getLocationID().trim()))
                            {
							    flag = true;
							}
                          } %>
						  <input type="checkbox" name='markAndPackLoc' class="txfield" <%= flag ? "checked":""%> >
						  <!--Bhaskar code block 22 oct 2003-->
						  <!--input type="checkbox" name='markAndPackLoc' class="txfield" checked-->
						  <font class="NArialL"><input type="hidden" name='findSelectedMarkAndPackLocations' value="<%=markAndPackLocation.getLocationID()%>" class="txfield" ></font>
						</td>
						<td width='20%' class='NArialL' ><%=markAndPackLocation.getLocationName()%></td>
				   <% } %>
            	</tr>
	        <% } else {
              //if(ifMarkPresent.getLocationID() ==null) { noLocations = true; %>
		       <input type = "hidden" name='markAndPackLoc' class="txfield" value = "-1">
		    <% } %>

          <%
              ArrayList finishedGoodsLocationArrayList  = (ArrayList)request.getAttribute("finishedGoodsLocations");
              VendorLocation ifFinishedPresent = new VendorLocation();
	          ifFinishedPresent = (VendorLocation)finishedGoodsLocationArrayList.get(0);
	          if (ifFinishedPresent.getLocationID() !=null){
	                //if ( !noLocations )
                     noLocations = false; %>
	                <tr>
                    <td width="25%" class='NArialL' ><font align="center">FINISHED GOODS</font></td>
    				<%
	    			VendorLocation finishedGoodsLocation = new VendorLocation();
					for (int i =0;i<finishedGoodsLocationArrayList.size();i++ ){
						finishedGoodsLocation = (VendorLocation)finishedGoodsLocationArrayList.get(i);%>
						<td bgcolor="#993333" width="2%" align="center" >
						<!--Bhaskar code block 22 oct 2003-->
						<% int size = checked.size();
						flag = false;
						for (int checkedLocations = 0; (checkedLocations < size && flag==false); checkedLocations++ )
                        {
						     if (((VendorLocation)checked.get(checkedLocations)).getLocationID().trim().equalsIgnoreCase(finishedGoodsLocation.getLocationID().trim()))
                             {
							    flag = true;
							 }
                        } %>
						<input type="checkbox" name='finishedGoodsLoc' class="txfield" <%= flag ? "checked":""%> >
						<!--Bhaskar code block 22 oct 2003-->
						<!--input type="checkbox" name='finishedGoodsLoc' class="txfield" checked-->
						<font class="NArialL"><input type="hidden" name='findSelectedFinishedGoodsLocations' value="<%=finishedGoodsLocation.getLocationID()%>" class="txfield" ></font>
						</td>
						<td width='20%' class='NArialL' ><%=finishedGoodsLocation.getLocationName()%></td>
				<% } %>
        	</tr>
	    <% } else {
	        //if (ifFinishedPresent.getLocationID() ==null) { noLocations = true; %>
		     <input type="hidden" name='finishedGoodsLoc' class="txfield" value = "-1">
		<% } %>
	    <% if ( noLocations ) { %>
	        <tr><td colspan=7 align='center' class='NArialL'><font color='red'>
	            Please select valid locations for Vendors inorder to setup the Adaptors</font>
	        </td></tr>
	    <% } else { %>
        	<tr><td colspan=7><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
        	<tr><td colspan=7 align=center>
			<!--Bhaskar commented on 22 october 2003 and place the restricted link-->
            <!--A Href="javascript:submitSetup();"><img src="< %=chipTracContext%>/jsp/includes/images/next.gif" border=0></A-->
			<chiptrack:restrictedLink functionality="<%=Functionality.ADAPTER_SETUP%>" action="<%=User.USER_ACTION_MODIFY%>" href="javascript:submitSetup();"  onmouseover="window.status='Click to setup Adapters';return true"  onmouseout="window.status='';return true"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/next.gif" onMouseOver="window.status='Click to Continue Adapter Setting';return true" onMouseout="window.status='';return true" title="Click here to Continue Adapter Setting"></chiptrack:restrictedLink>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <A href="javascript:document.adapterSetupForm.reset();"><img src="<%=chipTracContext%>/jsp/includes/images/reset.gif" border=0 onMouseOver="window.status='Click to Reset Adapter Setting';return true" onMouseout="window.status='';return true" title="Click here to Reset Adapter Setting"></A>
            </td>
            </tr>
	    <% } %>
	    </table>
    </html:form>
    <!-- till here -->
    <BR><BR><BR></TD>
    <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
    </TR>
    </TABLE>
    <!-- Footer starts here -->
    <%@include file="/jsp/includes/footer.jsp" %>
    <!-- footer end here -->
  </BODY>
</HTML>